/******************************************************************************
*
* Copyright (C) 2014 -2016 Hisilicon Technologies Co., Ltd.  All rights reserved.
*
* This program is confidential and proprietary to Hisilicon  Technologies Co., Ltd. (Hisilicon),
*  and may not be copied, reproduced, modified, disclosed to others, published or used, in
* whole or in part, without the express prior written permission of Hisilicon.
*
*****************************************************************************

  File Name     : pq_mng_acm.h
  Version       : Initial Draft
  Author        : sdk
  Created       : 2014/4/22
  Description   :

******************************************************************************/
#ifndef __PQ_MNG_ACM_COEF_H__
#define __PQ_MNG_ACM_COEF_H__

//#include "pq_mng_pq_table.h"
#include "pq_mng_acm.h"
#include "pq_hal_comm.h"
#include "drv_pq_table.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */


static HI_U32 sg_u32ColorGain[PQ_SOURCE_MODE_BUTT][COLOR_GAIN_BUTT][ACM_EH_GAIN_BUTT] =
{
    {{0, 0, 0}, {72, 72, 72}, {112, 112, 112}, {156, 156, 156}}, /* PQ_SOURCE_MODE_NO  */
    {{0, 0, 0}, {64, 64, 64}, { 98,  98,  98}, {122, 122, 122}}, /* PQ_SOURCE_MODE_SD  */
    {{0, 0, 0}, {72, 72, 72}, {112, 112, 112}, {156, 156, 156}}, /* PQ_SOURCE_MODE_HD  */
    {{0, 0, 0}, {88, 88, 88}, {128, 128, 128}, {172, 172, 172}}, /* PQ_SOURCE_MODE_UHD */
};

HI_S16 s16HueLut[9][13][29] =
{
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
    {
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
        { 18, 16, 13, 7, -1, -3, -2, 0, 3, 4, 4, 2, -1, -5, -10, -13, -14, -13, -11, -7, -1, 16, 14, 7, 0, -4, -8, -2, 18, },
    },
};

HI_S16 s16SatLut[9][13][29] =
{
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 9, 6, 4, 4, 7, 7, 3, 3, 3, 7, 11, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 16, 10, 9, 8, 12, 12, 5, 6, 6, 13, 19, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 21, 15, 13, 11, 16, 16, 7, 8, 8, 18, 25, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 26, 18, 16, 14, 19, 19, 8, 10, 10, 22, 31, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 30, 22, 19, 16, 22, 22, 9, 11, 12, 25, 36, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 33, 25, 23, 19, 25, 25, 10, 12, 13, 28, 40, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 36, 27, 26, 21, 27, 27, 11, 13, 14, 30, 43, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 39, 30, 28, 23, 28, 28, 12, 14, 15, 32, 46, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 40, 31, 30, 24, 30, 30, 12, 15, 15, 33, 48, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 41, 33, 31, 25, 30, 31, 13, 15, 16, 34, 49, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 42, 34, 33, 26, 31, 31, 13, 16, 16, 35, 50, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 42, 34, 33, 26, 31, 31, 13, 16, 16, 35, 50, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 6, 5, 6, 9, 10, 8, 10, 10, 13, 17, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 12, 10, 11, 16, 18, 15, 18, 18, 23, 29, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 17, 15, 16, 22, 25, 20, 24, 25, 31, 38, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 21, 19, 20, 27, 30, 25, 30, 31, 39, 47, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 25, 23, 24, 31, 35, 28, 34, 36, 45, 53, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 28, 27, 28, 34, 39, 32, 38, 40, 50, 59, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 31, 30, 31, 37, 42, 34, 41, 43, 54, 65, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 34, 33, 34, 39, 45, 36, 44, 46, 57, 68, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 36, 35, 36, 41, 47, 38, 46, 48, 60, 71, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 38, 37, 37, 42, 48, 39, 47, 49, 61, 74, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 39, 38, 38, 43, 49, 40, 48, 50, 63, 75, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 39, 39, 38, 43, 49, 40, 48, 50, 63, 75, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 5, 7, 11, 13, 13, 16, 16, 17, 20, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 14, 19, 23, 23, 28, 28, 29, 34, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 16, 19, 26, 31, 31, 37, 39, 40, 45, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 20, 24, 32, 38, 38, 46, 48, 49, 55, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 24, 29, 36, 44, 44, 53, 55, 56, 63, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 29, 34, 40, 49, 49, 59, 61, 63, 70, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 33, 38, 44, 53, 53, 64, 67, 68, 77, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 35, 40, 47, 56, 56, 68, 71, 72, 81, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 38, 43, 49, 59, 59, 71, 74, 75, 85, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 40, 45, 50, 60, 61, 73, 76, 78, 87, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 41, 45, 51, 62, 62, 74, 78, 79, 89, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 42, 46, 51, 62, 62, 74, 78, 79, 89, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 12, 15, 17, 20, 20, 19, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 21, 27, 29, 35, 36, 34, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 29, 36, 40, 47, 49, 46, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 26, 36, 45, 49, 59, 61, 57, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 31, 41, 52, 56, 67, 70, 66, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 37, 46, 57, 62, 75, 78, 73, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 41, 50, 62, 68, 82, 85, 79, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 44, 53, 66, 72, 86, 90, 84, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 46, 55, 69, 75, 90, 94, 88, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 48, 57, 71, 77, 93, 97, 91, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 49, 58, 73, 79, 95, 99, 92, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 50, 58, 73, 79, 95, 99, 92, 100, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 13, 16, 19, 23, 23, 21, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 23, 29, 33, 40, 41, 38, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 31, 39, 45, 54, 56, 51, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 27, 38, 48, 56, 67, 70, 63, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 32, 43, 55, 64, 77, 80, 73, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 38, 48, 62, 71, 85, 89, 81, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 42, 52, 67, 77, 93, 97, 88, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 45, 56, 71, 82, 98, 102, 93, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 47, 58, 74, 86, 103, 107, 97, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 49, 60, 76, 88, 106, 110, 100, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 50, 61, 78, 90, 108, 113, 102, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 51, 61, 78, 90, 108, 113, 102, 100, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 13, 16, 20, 24, 24, 23, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 23, 29, 36, 43, 44, 41, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 31, 39, 49, 58, 61, 55, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 27, 38, 48, 60, 72, 75, 68, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 32, 43, 55, 69, 83, 86, 78, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 38, 48, 62, 77, 92, 96, 87, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 42, 52, 67, 83, 100, 104, 95, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 45, 56, 71, 88, 106, 110, 100, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 47, 58, 74, 92, 111, 115, 105, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 49, 60, 76, 95, 114, 119, 108, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 50, 61, 78, 97, 116, 121, 110, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 51, 61, 78, 97, 116, 121, 110, 100, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 13, 16, 21, 25, 25, 23, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 23, 29, 37, 44, 45, 41, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 31, 39, 50, 60, 63, 55, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 27, 38, 48, 62, 74, 78, 68, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 32, 43, 55, 71, 85, 89, 78, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 38, 48, 62, 79, 95, 99, 87, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 42, 52, 67, 86, 103, 108, 95, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 45, 56, 71, 91, 109, 114, 100, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 47, 58, 74, 95, 114, 119, 105, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 49, 60, 76, 98, 118, 123, 108, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 50, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 51, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 13, 16, 21, 25, 25, 23, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 23, 29, 37, 44, 45, 41, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 31, 39, 50, 60, 63, 55, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 27, 38, 48, 62, 74, 78, 68, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 32, 43, 55, 71, 85, 89, 78, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 38, 48, 62, 79, 95, 99, 87, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 42, 52, 67, 86, 103, 108, 95, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 45, 56, 71, 91, 109, 114, 100, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 47, 58, 74, 95, 114, 119, 105, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 49, 60, 76, 98, 118, 123, 108, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 50, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 51, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4, 3, 3, 0, 0, 0, 0, },
        { 33, 26, 19, 14, 12, 10, 11, 11, 12, 15, 17, 17, 16, 13, 10, 7, 6, 8, 13, 16, 21, 25, 25, 23, 22, 21, 23, 26, 33, },
        { 58, 45, 33, 25, 21, 17, 21, 21, 20, 26, 30, 30, 28, 23, 17, 13, 11, 15, 23, 29, 37, 44, 45, 41, 38, 37, 41, 46, 58, },
        { 78, 61, 45, 34, 28, 23, 27, 27, 28, 36, 41, 41, 38, 31, 23, 18, 17, 21, 31, 39, 50, 60, 63, 55, 50, 50, 55, 63, 78, },
        { 97, 76, 56, 42, 35, 29, 31, 31, 34, 44, 51, 51, 47, 38, 29, 22, 21, 27, 38, 48, 62, 74, 78, 68, 62, 62, 68, 78, 97, },
        { 111, 87, 64, 48, 40, 33, 34, 34, 39, 50, 58, 58, 54, 44, 33, 26, 26, 32, 43, 55, 71, 85, 89, 78, 71, 71, 78, 89, 111, },
        { 123, 96, 71, 54, 44, 36, 37, 37, 43, 56, 65, 65, 60, 49, 36, 30, 30, 38, 48, 62, 79, 95, 99, 87, 79, 79, 87, 99, 123, },
        { 134, 105, 77, 58, 48, 40, 39, 39, 47, 61, 71, 71, 65, 53, 40, 33, 34, 42, 52, 67, 86, 103, 108, 95, 86, 86, 95, 108, 134, },
        { 142, 111, 82, 62, 51, 42, 41, 41, 50, 65, 75, 75, 69, 56, 42, 36, 37, 45, 56, 71, 91, 109, 114, 100, 91, 91, 100, 114, 142, },
        { 148, 116, 86, 65, 53, 44, 42, 42, 52, 67, 78, 78, 72, 59, 44, 38, 40, 47, 58, 74, 95, 114, 119, 105, 95, 95, 105, 119, 148, },
        { 153, 120, 88, 67, 55, 45, 44, 44, 54, 70, 80, 80, 74, 61, 45, 40, 41, 49, 60, 76, 98, 118, 123, 108, 98, 98, 108, 123, 153, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 43, 50, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
        { 156, 122, 90, 68, 56, 46, 44, 44, 55, 71, 82, 82, 76, 62, 46, 42, 44, 51, 61, 78, 100, 120, 125, 110, 100, 100, 110, 125, 156, },
    },
};

HI_S16 s16LumaLut[9][13][29] =
{
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
    {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { -10, -7, -5, -4, -4, -3, -2, -1, 0, 2, 3, 3, 1, 0, -1, -2, -1, -1, -1, -3, -8, -3, -1, -1, -2, -4, -6, -8, -10, },
        { -23, -16, -12, -10, -8, -7, -5, -2, 1, 5, 7, 6, 2, -1, -3, -4, -3, -3, -3, -7, -17, -7, -3, -3, -5, -9, -13, -18, -23, },
        { -34, -24, -18, -15, -12, -11, -8, -4, 1, 8, 10, 9, 3, -2, -5, -6, -4, -4, -4, -10, -26, -11, -5, -4, -8, -14, -20, -27, -34, },
        { -46, -33, -25, -20, -17, -15, -11, -5, 1, 10, 14, 12, 4, -3, -6, -8, -6, -6, -6, -14, -35, -15, -7, -6, -11, -19, -27, -37, -46, },
        { -57, -41, -31, -25, -21, -18, -14, -7, 1, 13, 17, 15, 5, -4, -8, -11, -7, -7, -7, -17, -44, -19, -9, -7, -14, -24, -34, -46, -57, },
        { -68, -49, -37, -30, -25, -22, -16, -8, 2, 15, 20, 18, 6, -5, -10, -13, -9, -9, -9, -21, -52, -23, -10, -9, -17, -28, -40, -55, -68, },
        { -80, -57, -43, -35, -30, -26, -19, -10, 2, 18, 23, 22, 8, -6, -11, -15, -11, -10, -10, -24, -62, -27, -12, -10, -20, -34, -47, -65, -80, },
        { -91, -65, -49, -40, -34, -29, -22, -11, 2, 20, 27, 25, 9, -7, -13, -17, -12, -12, -12, -28, -70, -31, -14, -12, -23, -38, -54, -74, -91, },
        { -102, -73, -55, -45, -38, -33, -25, -12, 2, 23, 30, 28, 10, -7, -15, -19, -14, -13, -13, -31, -79, -34, -16, -13, -26, -43, -60, -83, -102, },
        { -114, -82, -62, -51, -42, -37, -28, -14, 3, 25, 33, 31, 11, -8, -17, -22, -15, -15, -15, -35, -88, -39, -18, -15, -29, -48, -68, -93, -114, },
        { -125, -90, -68, -55, -46, -40, -31, -15, 3, 28, 37, 34, 12, -9, -18, -24, -17, -16, -16, -38, -97, -42, -20, -16, -32, -53, -74, -102, -125, },
        { -136, -98, -74, -60, -51, -44, -33, -17, 3, 30, 40, 37, 13, -10, -20, -26, -18, -18, -18, -42, -105, -46, -21, -18, -35, -57, -81, -111, -136, },
    },
};

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif


